home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 44 / PC Actual CD 44.iso / Linux / Cygwin / full.exe / Disk1 / data1.cab / Tools / H-i586-cygwin32 / i586-cygwin32 / include / cygwin / socket.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-12-04  |  4.8 KB  |  150 lines

  1. #ifndef _CYGWIN_SOCKET_H
  2. #define _CYGWIN_SOCKET_H
  3.  
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif /* __cplusplus */
  7.  
  8. struct sockaddr {
  9.   unsigned short    sa_family;    /* address family, AF_xxx    */
  10.   char            sa_data[14];    /* 14 bytes of protocol address    */
  11. };
  12.  
  13. #include <asm/socket.h>            /* arch-dependent defines    */
  14. #include <cygwin/sockios.h>        /* the SIOCxxx I/O controls    */
  15. #include <cygwin/uio.h>            /* iovec support        */
  16. #include <sys/types.h>
  17.  
  18. struct linger {
  19.   unsigned short             l_onoff;    /* Linger active        */
  20.  unsigned short            l_linger;    /* How long to linger for    */
  21. };
  22.  
  23. struct msghdr 
  24. {
  25.     void    *    msg_name;    /* Socket name            */
  26.     int        msg_namelen;    /* Length of name        */
  27.     struct iovec *    msg_iov;    /* Data blocks            */
  28.     int         msg_iovlen;    /* Number of blocks        */
  29.     void     *    msg_accrights;    /* Per protocol magic (eg BSD file descriptor passing) */
  30.     int        msg_accrightslen;    /* Length of rights list */
  31. };
  32.  
  33. /* Socket types. */
  34. #define SOCK_STREAM    1        /* stream (connection) socket    */
  35. #define SOCK_DGRAM    2        /* datagram (conn.less) socket    */
  36. #define SOCK_RAW    3        /* raw socket            */
  37. #define SOCK_RDM    4        /* reliably-delivered message    */
  38. #define SOCK_SEQPACKET    5        /* sequential packet socket    */
  39. #define SOCK_PACKET    10        /* CYGWIN specific way of    */
  40.                     /* getting packets at the dev    */
  41.                     /* level.  For writing rarp and    */
  42.                     /* other similar things on the    */
  43.                     /* user level.            */
  44.  
  45. /* Supported address families. */
  46. /*
  47.  * Address families.
  48.  */
  49. #define AF_UNSPEC       0               /* unspecified */
  50. #define AF_UNIX         1               /* local to host (pipes, portals) */
  51. #define AF_INET         2               /* internetwork: UDP, TCP, etc. */
  52. #define AF_IMPLINK      3               /* arpanet imp addresses */
  53. #define AF_PUP          4               /* pup protocols: e.g. BSP */
  54. #define AF_CHAOS        5               /* mit CHAOS protocols */
  55. #define AF_NS           6               /* XEROX NS protocols */
  56. #define AF_ISO          7               /* ISO protocols */
  57. #define AF_OSI          AF_ISO          /* OSI is ISO */
  58. #define AF_ECMA         8               /* european computer manufacturers */
  59. #define AF_DATAKIT      9               /* datakit protocols */
  60. #define AF_CCITT        10              /* CCITT protocols, X.25 etc */
  61. #define AF_SNA          11              /* IBM SNA */
  62. #define AF_DECnet       12              /* DECnet */
  63. #define AF_DLI          13              /* Direct data link interface */
  64. #define AF_LAT          14              /* LAT */
  65. #define AF_HYLINK       15              /* NSC Hyperchannel */
  66. #define AF_APPLETALK    16              /* AppleTalk */
  67. #define AF_NETBIOS      17              /* NetBios-style addresses */
  68.  
  69. #define AF_MAX          18
  70. /*
  71.  * Protocol families, same as address families for now.
  72.  */
  73. #define PF_UNSPEC       AF_UNSPEC
  74. #define PF_UNIX         AF_UNIX
  75. #define PF_INET         AF_INET
  76. #define PF_IMPLINK      AF_IMPLINK
  77. #define PF_PUP          AF_PUP
  78. #define PF_CHAOS        AF_CHAOS
  79. #define PF_NS           AF_NS
  80. #define PF_ISO          AF_ISO
  81. #define PF_OSI          AF_OSI
  82. #define PF_ECMA         AF_ECMA
  83. #define PF_DATAKIT      AF_DATAKIT
  84. #define PF_CCITT        AF_CCITT
  85. #define PF_SNA          AF_SNA
  86. #define PF_DECnet       AF_DECnet
  87. #define PF_DLI          AF_DLI
  88. #define PF_LAT          AF_LAT
  89. #define PF_HYLINK       AF_HYLINK
  90. #define PF_APPLETALK    AF_APPLETALK
  91.  
  92. #define PF_MAX          AF_MAX
  93.  
  94. /* Maximum queue length specificable by listen.  */
  95. #define SOMAXCONN       5
  96.  
  97. /* Flags we can use with send/ and recv. */
  98. #define MSG_OOB         0x1             /* process out-of-band data */
  99. #define MSG_PEEK        0x2             /* peek at incoming message */
  100. #define MSG_DONTROUTE   0x4             /* send without using routing tables */
  101.  
  102. /* Setsockoptions(2) level. Thanks to BSD these must match IPPROTO_xxx */
  103. #define SOL_IP        0
  104. #define SOL_IPX        256
  105. #define SOL_AX25    257
  106. #define SOL_ATALK    258
  107. #define    SOL_NETROM    259
  108. #define SOL_TCP        6
  109. #define SOL_UDP        17
  110.  
  111. /* IP options */
  112. #define    IPTOS_LOWDELAY        0x10
  113. #define    IPTOS_THROUGHPUT    0x08
  114. #define    IPTOS_RELIABILITY    0x04
  115.  
  116. /* These need to appear somewhere around here */
  117. #define IP_DEFAULT_MULTICAST_TTL        1
  118. #define IP_DEFAULT_MULTICAST_LOOP       1
  119. #define IP_MAX_MEMBERSHIPS              20
  120.  
  121. /* IP options for use with WinSock */
  122.  
  123. #define IP_OPTIONS          1
  124. #define IP_MULTICAST_IF     2
  125. #define IP_MULTICAST_TTL    3
  126. #define IP_MULTICAST_LOOP   4
  127. #define IP_ADD_MEMBERSHIP   5
  128. #define IP_DROP_MEMBERSHIP  6
  129. #define IP_TTL              7
  130. #define IP_TOS              8
  131. #define IP_DONTFRAGMENT     9
  132.  
  133. /* IPX options */
  134. #define IPX_TYPE    1
  135.  
  136. /* TCP options - this way around because someone left a set in the c library includes */
  137. #define TCP_NODELAY     0x0001
  138. #define TCP_MAXSEG    2
  139.  
  140. /* The various priorities. */
  141. #define SOPRI_INTERACTIVE    0
  142. #define SOPRI_NORMAL        1
  143. #define SOPRI_BACKGROUND    2
  144.  
  145. #ifdef __cplusplus
  146. };
  147. #endif /* __cplusplus */
  148.  
  149. #endif /* _CYGWIN_SOCKET_H */
  150.